package com.jic.veteran.controller;

import com.jic.veteran.common.api.CommonResult;
import com.jic.veteran.service.AlumniAddresslistService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;

/**
 * 通讯录controller
 * Created by mars on 2021/11/23.
 */
@RestController
@Api(tags = "AlumniAddresslistController",description = "通讯录")
@RequestMapping("/addresslist")
public class AlumniAddresslistController {

    @Autowired
    private AlumniAddresslistService alumniAddresslistService;

    @ApiOperation("上传文件")
    @RequestMapping(value = "/upload", method = RequestMethod.POST)
    @ResponseBody
    public CommonResult upExplain(@RequestParam("file") MultipartFile file) {

        int count =  alumniAddresslistService.importExcel(file);
        return CommonResult.success(count);
    }
}
